﻿/*********************************************************************************/
/**    Sims3Pack Readme Generator                                               **/
/**    Copyright (C) 2012  Anja Knackstedt                                      **/
/**                                                                             **/
/**    This program is free software: you can redistribute it and/or modify     **/
/**    it under the terms of the GNU General Public License as published by     **/
/**    the Free Software Foundation, either version 3 of the License, or        **/
/**    (at your option) any later version.                                      **/
/**                                                                             **/
/**    This program is distributed in the hope that it will be useful,          **/
/**    but WITHOUT ANY WARRANTY; without even the implied warranty of           **/
/**    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            **/
/**    GNU General Public License for more details.                             **/
/**                                                                             **/
/**    You should have received a copy of the GNU General Public License        **/
/**    along with this program.  If not, see <http://www.gnu.org/licenses/>.    **/
/**                                                                             **/
/*********************************************************************************/




using System.Collections.Generic;

namespace Sims3PackReadmeGenerator.ContentDesciption
{   
    /// <summary>
    /// lot specific information
    /// </summary>
    class PackagedLotDescription : PackagedFileDescription, IPackagedSimGroupDescription
    {
        #region fields

        private bool _isOccupied    = false;
        private bool _isCommunity   = false;
        private List<SimpleSimDescription> _simList = new List<SimpleSimDescription>();

        #endregion

        #region properties

        public string MetaName                  { get; set; }
        public string MetaDescription           { get; set; }
        public string Bio                       { get; set; }
        public string NumOfThumbs               { get; set; }
        public string MaxLevel                  { get; set; }
        public string MinLevel                  { get; set; }
        public string DimX                      { get; set; }
        public string DimZ                      { get; set; }
        public DescriptionItem LotType          { get; set; }
        public DescriptionItem LotResSubType    { get; set; }
        public DescriptionItem LotComSubType    { get; set; }
        public string LotHouseholdName          { get; set; }
        public string Funds                     { get; set; }
        public string Size                      { get; set; }
        public bool IsOccupied
        {
            get
            {
                return _isOccupied;
            }
            set
            {
                _isOccupied = value;
            }
        }
        public bool IsCommunityLot
        {
            get
            {
                return _isCommunity;
            }
            set
            {
                _isCommunity = value;
            }
        }

        #endregion

        #region constructor

        public PackagedLotDescription(PackagedFileDescription packFileDescr)
        {
            this.Name           = packFileDescr.Name;
            this.Length         = packFileDescr.Length;
            this.Offset         = packFileDescr.Offset;
            this.Guid           = packFileDescr.Guid;
            this.ContentType    = packFileDescr.ContentType;
           
            this.LotType        = new DescriptionItem();
            this.LotComSubType  = new DescriptionItem();
            this.LotResSubType  = new DescriptionItem();
        }

        #endregion

        #region methods

        public void addSimDescription(SimpleSimDescription simDescription)
        {
            _simList.Add(simDescription);
        }

        public List<SimpleSimDescription> getSimsList()
        {
            return _simList;
        }

        #region output methods

        public string getLotMetaName()
        {
            return this.MetaName;
        }

        public string getLotDescription()
        {
            return this.MetaDescription;
        }

        public string getLotBio()
        {
            return this.Bio;
        }

        public string getLotMaxLevel()
        {
            return this.MaxLevel;
        }

        public string getLotMinLevel()
        {
            return this.MinLevel;
        }

        public string getLotSize()
        {
            return DimX + " x " + DimZ;
        }

        public string getLotSuperType(Languages lang)
        {
            if (lang == Languages.de)
            {
                return this.LotType.DE;
            }
            else
            {
                return this.LotType.EN;
            }
        }

        public string getLotComSubType(Languages lang)
        {
            if (lang == Languages.de)
            {
                return this.LotComSubType.DE;
            }
            else
            {
                return this.LotComSubType.EN;
            }
        }

        public string getLotResSubType(Languages lang)
        {
            if (lang == Languages.de)
            {
                return this.LotResSubType.DE;
            }
            else
            {
                return this.LotResSubType.EN;
            }
        }

        public string getLotType(Languages lang)
        {
            
            string type = "";

            if (lang == Languages.de)
            {
                //only community lot subtypes
                if (LotComSubType.DE != "0" && LotComSubType.DE != "")
                {
                    type = LotComSubType.DE;
                }
                else
                {
                    type = LotType.DE;
                }
            }
            else
            {
                //only community lot subtypes
                if (LotComSubType.EN != "0" && LotComSubType.EN != "")
                {
                    type = LotComSubType.EN;
                }
                else
                {
                    type = LotType.EN;
                }
            }
            
            return type;
        }

        public string getLotHouseholdName()
        {
            return this.LotHouseholdName;
        }

        public string getLotFunds()
        {
            return this.Funds;
        }

        #endregion

        #endregion

    }
}
